package org.hhf.ai.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

@Configuration
public class WebClientConfig {

    @Autowired
    private AiConfig aiConfig;

    @Bean
    public WebClient webClient() {
        return WebClient.builder()
                .baseUrl(aiConfig.getHost()) // DeepSeek API 地址
                .defaultHeader("Authorization", "Bearer "+ aiConfig.getApiKey())
                .defaultHeader("Content-Type", "application/json;charset=utf-8")
                .build();
    }
}
